home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000142_icon-group-sender _Sat May 7 17:33:23 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
4KB
Received: by cheltenham.cs.arizona.edu; Tue, 24 May 1994 20:10:59 MST
Path: ucbvax!cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!udel!rochester!rit!nmw1638
From: nmw1638@cs.rit.edu (Nicolas M Williams)
Newsgroups: comp.lang.icon
Subject: Re: Regular expressions & dynamic linking (was Re: Spitbol vs. Icon)
Message-Id: <1994May7.173323.3010@cs.rit.edu>
Date: 7 May 94 17:33:23 GMT
References: <CpC86B.K2C@stortek.com> <1994May5.223307.19549@cs.rit.edu> <CpDx7B.H1o@stortek.com>
Sender: news@cs.rit.edu (USENET News Admin)
Organization: Rochester Institute of Technology, Rochester, NY
Lines: 76
Nntp-Posting-Host: iowa
Apparently-To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
In article <CpDx7B.H1o@stortek.com> cheyenne@witsend.stortek.com (Cheyenne Wills) writes:
>In <1994May5.223307.19549@cs.rit.edu>, nmw1638@cs.rit.edu (Nicolas M Williams) writes:
>>In article <CpC86B.K2C@stortek.com> cheyenne@witsend.stortek.com (Cheyenne Wills) writes:
>Hmmm.... well...
>One of Icon's design goals was (is) to provide a language that is
>fairly easily read. While one can write unreadable code in any language,
>some languages lend themselves to being more unreadable then others.
Heh, sure, look, there are single characters that have a lot of meaning
in Icon, where their meaning depends on the situation (e.g. / and \).
Plus recursive generators can be hard to figure out. No, Icon can be
very cryptic, which I in particular don't mind very much, after all, I'm
used to C and awk and sed and....
>Regular expressions are themselves a fullblown language, they have
>their place.
They can complement Icon, see below.
>I'm not saying that adding regular expressions to Icon is bad (or good),
>I'm just tring to say that with Icon, one can achive the same end result
>with existing facilities. In addition, Icon provides some facilities
>that just are not possible under regexps (try extracting "balanced
>strings" -- "(3+4*(5+6)*(10+11))". With regexps the best you can do
>with the above is: "(3+4*(5+6)".
Right, now imagine (I haven't seen the regexp library yet) a function
that returns the position of the subject string that marks the first
character of a string matched by a regexp, and another function that
returns the last character of said string provided you give it the
position of the first character of the matched string. That would fit in
quite well into the string scanning environment of Icon. I want regexps
not because they are good enough (which they are not), but because they
can simplify a lot of tasks.
> In addition a programmer can extend
>string pattern matching with their own functions, something that one
>cannot do with regexps. Once a useful pattern matching function
>has been built, one can save it for use later without having to
>reinvent it all over. If I need a pattern to match labels, I have
>an Icon function already coded that will do that. If I need a pattern
>to match "real numbers", I already have that, etc.
Yes, indeed, I have done this. So? Replacing a well commented regexp is
not that hard; I've done that too.
>Maintainability is always an issue. Even "throw-a-way" code has a
>tendancy to live a life longer then the author may have intended.
Yes, but regexps are seldom huge (several lines long), and if their
actions are well commented, replacing that regexp with another one is
not very hard. Yes, there is a maintainability issue, but I claim that
it is not crucial, not as crucial as the maintainability of pages of C
(or Icon for that matter) code.
>regexp "package" in the Icon Program Library.
Ok, I'd never been able to find the Icon libs, but I just did (archie
IPL), so I'll be looking through that as soon as I can get the time.
>Cheyenne
>+--------------------------------------+---------------------------------+
>| +-----+ | Cheyenne Wills |
>| | | "From here on up it is | Storage Technology Corporation |
>| | +--+--+ downhill all the way" | 2270 South 88th St. |
>| | | | | | Louisville, Co. 80028-4232 |
>| +--+--+ | These are not the | |
>| | | opinions or views of | Cheyenne_Wills@stortek.com |
>| +-----+ Storage Technology | cheyenne@witsend.stortek.com |
>+--------------------------------------+---------------------------------+
>
Nick